/*
 * FormFiller.h
 *
 *  Created on: 27/01/2009
 *      Author: desadoc
 */

#ifndef FORMFILLER_H_
#define FORMFILLER_H_

#include <QMainWindow>
#include <QTabWidget>
#include <QScrollArea>
#include <QPushButton>
#include <QLineEdit>

#include "FormFillerInstance.h"

QT_BEGIN_NAMESPACE
class QAction;
class QMenu;
class QMdiSubWindow;
class QSignalMapper;
QT_END_NAMESPACE

class FormFiller : public QMainWindow
{
    Q_OBJECT

public:
	FormFiller(QWidget* parent, Qt::WindowFlags flags);

protected:
    void closeEvent(QCloseEvent *event);

private slots:
    void newFile();
    void open();
    void save();
    void saveAs();
    void close();
    void closeFile();

    void firstReg(void);
    void previousReg(void);
    void nextReg(void);
    void lastReg(void);

    void addReg(void);
    void removeReg(void);

private:
    void createActions();
    void createMenus();
    void createToolBars();
    void createStatusBar();

    QToolBar *fileToolBar;
    QAction *newAct;
    QAction *openAct;
    QAction *saveAct;
    QAction *saveAsAct;
    QAction *validate;
    QAction *exitAct;
    QAction *closeAct;
    QAction *closeAllAct;

    int sequenceNumber;

    FormFillerInstance* filler;
    QScrollArea* scroll;

    QPushButton *first;
    QPushButton *previous;
    QPushButton *next;
    QPushButton *last;

    QLineEdit *regNumber;

    QPushButton *add;
    QPushButton *remove;
};

#endif /* FORMFILLER_H_ */
